﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ExaminationSys.Helper;
using System.Web.SessionState;

namespace ExaminationSys.ashx
{
    /// <summary>
    /// SignOutHandler 的摘要说明
    /// </summary>
    public class SignOutHandler : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var formsAuth = new FormsAuthenticationHelper.FormsAuthenticationService();
            formsAuth.SignOut();
            FormsAuthenticationHelper.RemoveTeacherCookie();
            context.Session["TeacherInfo"] = null; 
            context.Response.Write("200");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}